#include <stdio.h>
#include "ARMCM3.h"
#include "tinyos.h"

task_t task_idle;
task_stack_t idle_stack[TINYOS_IDLE_STACK_SIZE];

void SysTick_Handler(void)
{
    task_systick_handle();
}

void idle_handle(void *param)
{
    int idle;
    
    idle = 0;
    for (;;) {
        idle++;
    }
}

int main()
{    
    task_sched_init();
    app_init();
    task_init(&task_idle, idle_handle,(void *)0x3333, &idle_stack[1024], 
        ARRAY_SIZE(idle_stack), TINYOS_PRO_COUNT - 1);

    cur_task = NULL;
    next_task = task_get_ready();
    os_start();
    return 0;
}
